@extends('layout.master')

@section('content-header')
    <h1>Penduduk</h1>
    <ol class="breadcrumb">
        <li><a href="/"><i class="fa fa-dashboard"></i> Dashboard</a></li>
        <li><a href="{{ URL::to('penduduk') }}"><i class="fa fa-group"></i>Penduduk</a></li>
        <li class="active"><i class="fa fa-pencil"></i> Edit</li>
    </ol>
@stop

@section('content')
<div class="row">
    <div class="col-xs-12">
        <div class="box">
            <div class="box-body table-responsive">
		    	<div class="callout callout-warning">
		    		<h4>Informasi!</h4>
		    		<p>Mohon isi data dengan lengkap.</p>
			    	@foreach ($errors->all() as $element)
			    		{{ $element }}</br>
			    	@endforeach
		    	</div>
				{{ Form::model($penduduk, array('route'=>array('penduduks.update', $penduduk->id), 'method'=>'PUT', 'class'=>'form-horizontal', 'role'=>'form')) }}
					<?php
						$penduduk->ref_id == ''? $ref_id = $penduduk->id : $ref_id = $penduduk->ref_id;
					?>
					{{Form::hidden('user_id', Auth::user()->id)}}
					{{Form::hidden('ref_id', $ref_id)}}
					{{Form::hidden('action', 2)}}
					{{Form::hidden('nik', $penduduk->nik)}}
					<div class="form-group">
						<label class="col-sm-2 control-label required">NIK</label>
						<div class="col-sm-10">
							{{Form::text('nik', null, array('class'=>'form-control', 'disabled'=>'disabled'))}}
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-2 control-label required">Nomor KK</label>
						<div class="col-sm-10">
							{{Form::text('no_kk', null, array('class'=>'form-control'))}}
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-2 control-label required">Nama</label>
						<div class="col-sm-10">
							{{Form::text('nama', null, array('class'=>'form-control uppercase-text'))}}
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-2 control-label required">Jenis kelamin</label>
						<div class="col-sm-10">
							<div class="form-control" style="border:none">
								{{Form::radio('jenis_kelamin', 'L')}}
								{{'Laki-laki'}}
								{{Form::radio('jenis_kelamin', 'P')}}
								{{'Perempuan'}}
							</div>
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-2 control-label required">Tanggal lahir</label>
						<div class="col-sm-4">
							{{Form::text('tanggal_lahir', null, array('class'=>'form-control', 'id'=>'tanggal_lahir', 'type'=>'text'))}}
						</div>
						<label class="col-sm-2 control-label required">Tempat lahir</label>
						<div class="col-sm-4">
							{{Form::text('tempat_lahir', null, array('class'=>'form-control'))}}
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-2 control-label required">Agama</label>
						<div class="col-sm-4">
							{{ Form::select('agama_id', $agamas, null, array('class'=>'form-control')) }}
						</div>
						<label class="col-sm-2 control-label required">Pendidikan</label>
						<div class="col-sm-4">
							{{Form::select('pendidikan_id', $pendidikans, null, array('class'=>'form-control'))}}
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-2 control-label required">Jenis pekerjaan</label>
						<div class="col-sm-4">
							{{Form::select('jenis_pekerjaan_id', $jenispekerjaans, null, array('class'=>'form-control'))}}
						</div>
						<label class="col-sm-2 control-label required">Golongan darah</label>
						<div class="col-sm-4">
							{{Form::select('golongan_darah', array('' => '- - Pilih Golongan Darah - -', 'O' => 'O', 'A' => 'A', 'B' => 'B', 'AB' => 'AB'), null, array('class'=>'form-control'))}}
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-2 control-label required">Status keluarga</label>
						<div class="col-sm-4">
							{{Form::select('status_keluarga_id', $statuskeluargas, null, array('class'=>'form-control'))}}
						</div>
						<label class="col-sm-2 control-label required">Status kawin</label>
						<div class="col-sm-4">
							{{Form::select('status_kawin', array('' => '- - Pilih Status Kawin - -', 'kawin' => 'Kawin', 'belum kawin' => 'Belum Kawin', 'cerai mati' => 'Cerai Mati', 'cerai hidup' => 'Cerai Hidup'), null, array('class'=>'form-control'))}}
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-2 control-label required">Status penduduk</label>
						<div class="col-sm-10">
							<div class="form-control" style="border:none">
								{{Form::radio('is_lokal', '1')}}
								{{'Penduduk lokal'}}
								{{Form::radio('is_lokal', '0')}}
								{{'Penduduk dinas'}}
							</div>
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-2 control-label required">Warga negara</label>
						<div class="col-sm-10">
							{{Form::text('warga_negara', null, array('class'=>'form-control'))}}
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-2 control-label">Nomor paspor</label>
						<div class="col-sm-10">
							{{Form::text('paspor', null, array('class'=>'form-control'))}}
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-2 control-label">Nomor KITAS</label>
						<div class="col-sm-10">
							{{Form::text('kitas', null, array('class'=>'form-control'))}}
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-2 control-label">Nama ayah</label>
						<div class="col-sm-10">
							{{Form::text('ayah', null, array('class'=>'form-control'))}}
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-2 control-label">Nama ibu</label>
						<div class="col-sm-10">
							{{Form::text('ibu', null, array('class'=>'form-control'))}}
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-2 control-label">Keterangan</label>
						<div class="col-sm-10">
							{{Form::textarea('keterangan', null, array('class'=>'form-control'))}}
						</div>
					</div>
					<div class="form-group">
						<div class="col-sm-offset-2 col-sm-10">
							{{ HTML::decode(Form::button('<i class="fa fa-refresh"></i> Reset', array('class'=>'btn btn-success','type'=>'reset'))) }}
							{{ HTML::decode(Form::button('<i class="fa fa-floppy-o"></i> Simpan', array('class'=>'btn btn-primary','type'=>'submit'))) }}
						</div>
					</div>
				{{ Form::close() }}
            </div><!-- /.box-body -->
        </div><!-- /.box -->
    </div>
</div>
@stop

@section('javascript')
<script type="text/javascript">
	$(document).ready(function() {	
    	$("#tanggal_lahir").ionDatePicker({
				lang: "en",                     // language
			    sundayFirst: false,             // first week day
			    years: "80",                    // years diapason
			    format: "YYYY-MM-DD",           // date format
			});
	});
</script>
@stop